﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLayer.Model.Services.Abstract;
using BusinessLayer.Model.Services.Concrete;
using BusinessLayer.Model.Repositories.Abstract;
using DataAccess.Services;
using DataAccess.Repositories;


namespace intecnologia
{
    public partial class ViewImage : System.Web.UI.Page
    {
        protected IGalleryService _galleryService = new GalleryService();
        IPictureRepository _pictureRepository = new PictureRepository();

        protected string _imagePath;
        protected string _imageDescription;

        protected void Page_Load(object sender, EventArgs e)
        {
            _imagePath = _galleryService.GetImageFromBytes(_pictureRepository.FetchByID(new Guid(Request.QueryString["img"])));
            _imageDescription = (_pictureRepository.FetchByID(new Guid(Request.QueryString["img"]))).Description;
        }

        protected string GetTag()
        {
            return _galleryService.GetImageTag(_imagePath, Request);
        }
    }
}
